Skip to content

metabase: store associated object field in bytes #3971

Open
End-rey wants to merge 2 commits intomasterfrom
associated-object-field-format
Open

metabase: store associated object field in bytes #3971
End-rey wants to merge 2 commits intomasterfrom
associated-object-field-format

Conversation

@End-rey
Copy link
Copy Markdown
Contributor

@End-rey End-rey commented Apr 29, 2026

Closes #3926.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 57.42574% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 28.06%. Comparing base (8507997) to head (b438be9).

Files with missing lines Patch % Lines
pkg/local_object_storage/metabase/version.go 55.69% 24 Missing and 11 partials ⚠️
pkg/core/object/metadata.go 0.00% 3 Missing ⚠️
pkg/local_object_storage/metabase/get.go 60.00% 1 Missing and 1 partial ⚠️
pkg/local_object_storage/metabase/metadata.go 81.81% 1 Missing and 1 partial ⚠️
pkg/util/meta/test/metatest.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3971      +/-   ##
==========================================
+ Coverage   28.00%   28.06%   +0.06%     
==========================================
  Files         680      680              
  Lines       45293    45384      +91     
==========================================
+ Hits        12686    12739      +53     
- Misses      31429    31455      +26     
- Partials     1178     1190      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread pkg/local_object_storage/metabase/get.go Outdated
Comment thread pkg/local_object_storage/metabase/lock_test.go Outdated
target := obj.AssociatedObject()
if target.IsZero() {
return nil
return fmt.Errorf("%s object has zero associated object", obj.Type())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somewhat different problem, this nil was relevant before 5675b9d, now it's obsolete, yes.

Comment thread pkg/local_object_storage/metabase/version.go Outdated
@End-rey End-rey force-pushed the associated-object-field-format branch from 789c655 to bec2d00 Compare April 30, 2026 17:15
Comment thread pkg/local_object_storage/metabase/version.go Outdated
Comment thread pkg/local_object_storage/metabase/version.go Outdated
@roman-khimov
Copy link
Copy Markdown
Member

Changelog, btw.

@End-rey End-rey force-pushed the associated-object-field-format branch 2 times, most recently from ad24350 to 820d230 Compare May 4, 2026 19:37
Signed-off-by: Andrey Butusov <andrey@nspcc.io>
Comment thread pkg/local_object_storage/metabase/version.go Outdated
Comment thread pkg/local_object_storage/metabase/version.go Outdated
@End-rey End-rey force-pushed the associated-object-field-format branch from 820d230 to b438be9 Compare May 4, 2026 20:56
Store `__NEOFS__ASSOCIATE` in metabase as raw OID bytes instead of Base58.
Reject non-OID values for this attribute, add migration, update read/search
paths and cover the new layout in tests.

```
goos: linux
goarch: amd64
pkg: github.com/nspcc-dev/neofs-node/pkg/local_object_storage/metabase
cpu: AMD Ryzen 7 PRO 4750U with Radeon Graphics
                                           │    old.txt    │               new.txt               │
                                           │    sec/op     │   sec/op     vs base                │
Search/user_attribute-16                      17.76µ ±  2%   15.10µ ± 2%  -15.00% (p=0.000 n=10)
Search/associated_object_with_attribute-16    13.25µ ±  2%   15.20µ ± 8%  +14.68% (p=0.000 n=10)
IsLocked/locked-16                           11.464µ ±  2%   5.303µ ± 5%  -53.75% (p=0.000 n=10)
IsLocked/unlocked-16                          6.117µ ± 18%   3.112µ ± 2%  -49.12% (p=0.000 n=10)
geomean                                       11.33µ         7.844µ       -30.79%

                                           │   old.txt    │               new.txt                │
                                           │     B/op     │     B/op      vs base                │
Search/user_attribute-16                     2.547Ki ± 0%   2.445Ki ± 0%   -3.99% (p=0.000 n=10)
Search/associated_object_with_attribute-16   2.203Ki ± 0%   2.305Ki ± 0%   +4.61% (p=0.000 n=10)
IsLocked/locked-16                           1.455Ki ± 0%   1.250Ki ± 0%  -14.09% (p=0.000 n=10)
IsLocked/unlocked-16                           945.0 ± 0%     840.0 ± 0%  -11.11% (p=0.000 n=10)
geomean                                      1.657Ki        1.550Ki        -6.42%

                                           │  old.txt   │              new.txt               │
                                           │ allocs/op  │ allocs/op   vs base                │
Search/user_attribute-16                     52.00 ± 0%   50.00 ± 0%   -3.85% (p=0.000 n=10)
Search/associated_object_with_attribute-16   46.00 ± 0%   47.00 ± 0%   +2.17% (p=0.000 n=10)
IsLocked/locked-16                           33.00 ± 0%   29.00 ± 0%  -12.12% (p=0.000 n=10)
IsLocked/unlocked-16                         20.00 ± 0%   18.00 ± 0%  -10.00% (p=0.000 n=10)
geomean                                      35.45        33.28        -6.11%
```

Closes #3926.

Signed-off-by: Andrey Butusov <andrey@nspcc.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reconsider associated object field format in metabase

2 participants